package china.song314.testcode;

import java.util.HashMap;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import vStudio.Android.Camera360.Share.Tool.TDomXmlControl;

public class TestMap {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

	}
	
	public static HashMap<String, Object> GetInforFromServer(String xmlInfo) {
		HashMap<String, Object> map = null;
		TDomXmlControl myDomXmlControl = new TDomXmlControl();
		myDomXmlControl.LoadXmlFromString(xmlInfo);

		String strValue = myDomXmlControl.GetParamFromRoot(VALUE_STATUS);
		NodeList list = myDomXmlControl.GetNodeListFromRootWithName(VALUE_SUC);
		
		map = getUrlInfor(list);

		return map;
	}

	private static HashMap<String, Object> getUrlInfor(NodeList list) {
		HashMap<String, Object> map = null;
		for (int i = 0; i < list.getLength(); i++) {
			Node node = list.item(i);
			map = new HashMap<String, Object>();
			for (int j = 0; j < node.getAttributes().getLength(); j++) {

				String key = node.getAttributes().item(j).getNodeName();
				String value = node.getAttributes().item(j).getNodeValue();
				map.put(key, value);
			}
		}
		return map;
	}

}
